package com.dimples.controller;

import com.dimples.enums.BuildTableEnum;
import com.dimples.strategy.BuildTableStrategyFactory;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

import cn.hutool.core.lang.Console;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2022/5/12
 */
@Slf4j
@RestController
@RequestMapping
public class FileController {

    @PostMapping("cache2mysql")
    public void cache2mysql(MultipartFile file) {
        List<String> msg = BuildTableStrategyFactory.getStrategy(BuildTableEnum.CACHE_FILE).create(file, "");
        Console.log(msg);
    }
}
